<?php

namespace App\Http\Controllers\Admin\Member\Repository;

use App\Scenic;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
/**
 * App\Http\Controllers\Admin\Member\Repository\Member
 *
 * @property int $id
 * @property int $pid
 * @property string $path 代系树，如id为1的用户没有推广人则为0,1；id为2的用户推广人是1则为0,1,2
 * @property string|null $nickname
 * @property string|null $headimgurl
 * @property int|null $sex 1男2女
 * @property int|null $age 年龄
 * @property string|null $country 国家
 * @property string|null $province 省
 * @property string|null $city 市
 * @property string|null $area 区
 * @property string|null $address 详细地址
 * @property string|null $mobile
 * @property string|null $openid
 * @property string|null $bankId 银行卡号
 * @property float $wallet_all_push_money 总提成
 * @property float $wallet_used_push_money 已使用的提成
 * @property float $wallet_push_money 剩余提成
 * @property float $wallet_withdraw 提现金额
 * @property int $wallet_spots 剩余景点次数
 * @property int $consume 是否产生消费1是2否
 * @property int|null $info_complete 1已完善2未完善
 * @property int|null $is_listen 是否试听过1是0否
 * @property int|null $subscribe 用户是否订阅该公众号标识，值为0时，代表此用户没有关注该公众号，拉取不到其余信息。
 * @property int|null $status 1启用2禁用
 * @property int|null $role 1个人2旅行社
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @property int|null $game_num 游戏剩余次数
 * @property int|null $promote_num 推广人数
 * @property int|null $is_worker 设为工作人员
 * @property int|null $is_display 禁止查看提成
 * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications
 * @property-read \App\Http\Controllers\Admin\Member\Repository\Member $parent
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Scenic[] $scenic
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereAddress($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereAge($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereArea($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereBankId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereCity($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereConsume($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereCountry($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereGameNum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereHeadimgurl($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereInfoComplete($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereIsDisplay($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereIsListen($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereIsWorker($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereMobile($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereNickname($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereOpenid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member wherePath($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member wherePid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member wherePromoteNum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereProvince($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereRole($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereSex($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereSubscribe($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereWalletAllPushMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereWalletPushMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereWalletSpots($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereWalletUsedPushMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereWalletWithdraw($value)
 * @mixin \Eloquent
 * @property string|null $truename
 * @property string|null $id_number 身份证号
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereIdNumber($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Member\Repository\Member whereTruename($value)
 */
class Member extends Authenticatable
{
    //
    use Notifiable;

    protected $guard_name='member';
    protected $table = 'members';

    public function parent(){
        return $this->belongsTo('App\Http\Controllers\Admin\Member\Repository\Member','pid');
    }
    public function scenic(){
          return $this->belongsToMany('App\Scenic','scenic_buy','member_id','scenic');
    }
}
